package com.leedsoft.common;

import com.leedsoft.controller.vo.PageVo;
import org.springframework.core.NamedThreadLocal;

/**
 * Created by leeds on 2017/6/19.
 */
public class SysContext {
    private static final ThreadLocal<PageVo> pageInfo = new NamedThreadLocal<>("pagination info");
    static {
        pageInfo.set(new PageVo());
    }

    public static ThreadLocal<PageVo> getPageInfo() {
        return pageInfo;
    }

    public static int getPageNumber() {
        PageVo pageVo = pageInfo.get();
        return pageVo.getPageNumber();
    }

    public static int getPageSize() {
        PageVo pageVo = pageInfo.get();
        return pageVo.getPageSize();
    }


}
